package bookmanagementsystem.model;

import java.sql.Timestamp;

public class ReturningRecord {
    private String recordID;
    private String userID;
    private String bookID;
    private Timestamp returningTime;

    // 原有的构造函数，用于完整信息构建对象
    public ReturningRecord(String recordID, String userID, String bookID, Timestamp returningTime) {
        this.recordID = recordID;
        this.userID = userID;
        this.bookID = bookID;
        this.returningTime = returningTime;
    }

    // 新增构造函数，方便在归还图书操作时根据已有信息快速创建对象（不传入recordID，由系统生成）
    public ReturningRecord(String userID, String bookID, Timestamp returningTime) {
        this.userID = userID;
        this.bookID = bookID;
        this.returningTime = returningTime;
        this.recordID = "return_" + System.currentTimeMillis();
    }

    public String getRecordID() {
        return recordID;
    }

    public void setRecordID(String recordID) {
        this.recordID = recordID;
    }

    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public String getBookID() {
        return bookID;
    }

    public void setBookID(String bookID) {
        this.bookID = bookID;
    }

    public Timestamp getReturningTime() {
        return returningTime;
    }

    public void setReturningTime(Timestamp returningTime) {
        this.returningTime = returningTime;
    }
}